package com.ksyun.cloudhostalarmprocessing.common;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.UUID;

/**
 * 通用返回类
 */
@AllArgsConstructor
@Data
public class Response {

    //状态码
    private final Integer code;

    //请求id
    private final String requestId;

    //返回信息
    private final String Message;

    public static Response ok(){
        return new Response(CodeEnum.SUCCESS.getCode(), UUID.randomUUID().toString(),"ok");
    }

    public static Response error(Integer code,String Message){
        return new Response(code,UUID.randomUUID().toString(),Message);
    }
}
